package trading_strategy.events;

import trading_strategy.instruments.ListedInstrument;

/**
 * Created by IntelliJ IDEA.
 * User: gderoujoux
 * Date: 6 mai 2010
 * Time: 10:42:58
 * To change this template use File | Settings | File Templates.
 */
public class PublicTradeUpdate extends InstrumentEvent {
    public static enum TradeType {
        MARKET, BLOCK
    }
    public static enum TradeSide {
        BUY, SELL, UNKNOWN
    }
    int qty;
    double price;
    TradeType type;
    TradeSide side;

    public PublicTradeUpdate(PublicTradeUpdate trade) {
        super(trade.instrument);
        this.qty = trade.qty;
        this.price = trade.price;
        this.type = trade.type;
    }

    public PublicTradeUpdate(ListedInstrument instrument, int qty, double price, TradeType type, long ts) {
        this(instrument, qty, price, type, TradeSide.UNKNOWN, ts);
    }

    public PublicTradeUpdate(ListedInstrument instrument, int qty, double price, TradeType type, TradeSide side, long ts) {
        super(instrument, ts);
        this.qty = qty;
        this.price = price;
        this.type = type;
        this.side = side;
    }

    public int getQty() {
        return qty;
    }

    public double getPrice() {
        return price;
    }

    public TradeType getType() {
        return type;
    }

    public void setQty(int qty) {
        this.qty = qty;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void setType(TradeType type) {
        this.type = type;
    }

    public TradeSide getSide() {
        return side;
    }
}